#define  _CRT_SECURE_NO_WARNINGS
#include "SeqList.h"

void Test1(SeqList* ps)
{
	for (int i = 0; i < 10; i++)
	{
		SeqListPushBack(ps, i);
		SeqListPrint(ps);
	}
}

void Test2(SeqList* ps)
{
	for (int i = 0; i < 100; i++)
	{
		SeqListPushBack(ps, i);
	}
	for (int i = 90; i < 110; i++)
	{
		int tmp = SeqListFind(ps, i);
		if (tmp == -1)
		{
			printf("%d,not fount\n",i);
		}
		else
		{
			printf("%d,pos::%d\n", i, tmp);
		}
	}
}

void Test3(SeqList* ps)
{
	for (int i = 0; i < 5; i++)
	{
		SeqListPushFront(ps, i);
	}
	for (int i = 0; i < 5; i++)
	{
		SeqListPushBack(ps, i);
	}
	SeqListPrint(ps);
	for (int i = 0; i < 5; i++)
	{
		SeqListPopFront(ps, i);
		SeqListPrint(ps);
	}
	for (int i = 0; i < 5; i++)
	{
		SeqListPopBack(ps, i);
		SeqListPrint(ps);
	}
}

int main()
{
	SeqList seqlist;
	SeqListInit(&seqlist);

	//Test1(&seqlist);
	//Test2(&seqlist);
	Test3(&seqlist);

	SeqListDestroy(&seqlist);
	return 0;
}